import { PORT1 } from "@/api/config/servicePort";
import http from "@/api";
import { ReqPage, ResPage, ResultData } from "@/api/interface";
/**
 * @name 分页查询角色
 */
export const getApiKeyList = (params: ApiKey.ReqApiKey) => {
  return http.get<ResPage<ApiKey.ResApiKey>>(PORT1 + `/ai/api-key/page`, params);
};
export const saveApiKey = (params: ApiKey.ReqApiKey) => {
  return http.post<ResultData<Boolean>>(PORT1 + `/ai/api-key/save`, params);
};

export namespace ApiKey {
  export interface ResApiKey {
    id: number;
    name: string;
    apiKey: string;
    platform: string;
    url: string;
    status: number;
    createBy: number;
    createTime: Date;
    updateBy: number;
    updateTime: Date;
    isDeleted: number;
  }
  export interface ReqApiKey extends ReqPage {
    id: number;
    name: string;
    apiKey: string;
    platform: string;
    url: string;
    status: number;
    createBy: number;
    createTime: Date;
    updateBy: number;
    updateTime: Date;
    isDeleted: number;
  }
}
